package com.cskaoyan.Utils;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * @author ked
 * @createTime 2021年05月12日 23:28:00
 */


public class WxOrderStatusUtils {

    private Boolean cancel;
    private Boolean comment;
    private Boolean confirm;
    private Boolean delete;
    private Boolean pay;
    private Boolean rebuy;
    private Boolean refund;

    public WxOrderStatusUtils() {
    }

    public Boolean getCancel() {
        return cancel;
    }

    public void setCancel(Boolean cancel) {
        this.cancel = cancel;
    }

    public Boolean getComment() {
        return comment;
    }

    public void setComment(Boolean comment) {
        this.comment = comment;
    }

    public Boolean getConfirm() {
        return confirm;
    }

    public void setConfirm(Boolean confirm) {
        this.confirm = confirm;
    }

    public Boolean getDelete() {
        return delete;
    }

    public void setDelete(Boolean delete) {
        this.delete = delete;
    }

    public Boolean getPay() {
        return pay;
    }

    public void setPay(Boolean pay) {
        this.pay = pay;
    }

    public Boolean getRebuy() {
        return rebuy;
    }

    public void setRebuy(Boolean rebuy) {
        this.rebuy = rebuy;
    }

    public Boolean getRefund() {
        return refund;
    }

    public void setRefund(Boolean refund) {
        this.refund = refund;
    }

    public WxOrderStatusUtils(Boolean cancel, Boolean comment, Boolean confirm, Boolean delete, Boolean pay, Boolean rebuy, Boolean refund) {
        this.cancel = cancel;
        this.comment = comment;
        this.confirm = confirm;
        this.delete = delete;
        this.pay = pay;
        this.rebuy = rebuy;
        this.refund = refund;
    }

    public String orderStatus(short status){

        String orderStatus = null;

        switch(status){
            case 101 : orderStatus = "未付款";
                break;
            case 102 : orderStatus = "已取消";
                break;
            case 103 : orderStatus = "系统取消";
                break;
            case 201 : orderStatus = "已付款";
                break;
            case 202 : orderStatus = "申请退款";
                break;
            case 203 : orderStatus = "已退款";
                break;
            case 301 : orderStatus = "已发货";
                break;
            case 401 : orderStatus = "已收货";
                break;
            case 402 : orderStatus = "系统收货";
        }

        return orderStatus;

    }

    public WxOrderStatusUtils handleOption(short status){

        WxOrderStatusUtils handleOption;

        switch (status){
            case 101 : return handleOption = new WxOrderStatusUtils(true,false,false,false,true,false,false);
            case 102 : return handleOption = new WxOrderStatusUtils(false,false,false,true,false,false,false);
            case 103 : return handleOption = new WxOrderStatusUtils(false,false,false,true,false,false,false);
            case 201 : return handleOption = new WxOrderStatusUtils(false,false,false,false,false,false,true);
            case 202 : return handleOption = new WxOrderStatusUtils(false,false,false,false,false,false,false);
            case 203 : return handleOption = new WxOrderStatusUtils(false,false,false,true,false,false,false);
            case 301 : return handleOption = new WxOrderStatusUtils(false,false,true,false,false,false,true);
            case 401 : return handleOption = new WxOrderStatusUtils(false,true,false,true,false,true,false);
            case 402 : return handleOption = new WxOrderStatusUtils(false,true,false,true,false,true,false);
        }

        return handleOption = new WxOrderStatusUtils(false,false,false,false,false,false,false);
    }


}
